package com.yzy.soft.system.service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.yzy.soft.common.persistence.dao.DataextractrulesMapper;
import com.yzy.soft.common.persistence.dao.DataextractrulesdetailMapper;
import com.yzy.soft.common.persistence.model.Dataextractrulesdetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class RuleAcquisitionService {

    @Autowired
    private DataextractrulesMapper dataextractrulesMapper;
    @Autowired
    private DataextractrulesdetailMapper dataextractrulesdetailMapper;

    public List<Dataextractrulesdetail> getDataExtract(String tRuleDefID,String state,String arithmetictype,String subtype){
        java.util.List<String> where = new ArrayList<>();
        where.add("RuleDefID");
        where.add("DealOrder");
        Wrapper<Dataextractrulesdetail> wrapper = new EntityWrapper<>();
        wrapper.where("ruledefid={0} and state={1} and arithmetictype={2} and subtype={3}", tRuleDefID, state, arithmetictype, subtype).orderBy(true, where, true);;
        List<Dataextractrulesdetail> dataextractrulesdetailList = dataextractrulesdetailMapper.selectList(wrapper);
        return dataextractrulesdetailList;
    }
}
